home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 12 / Cream of the Crop 12 (Part II) / Cream of the Crop 12 (Part II).iso / OS2 / VD08BIN.ZIP / usr / include / util / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-13  |  1.6 KB  |  60 lines

  1. /* -------------------------------------------------------------------
  2.  
  3.     Project: General utility classes
  4.  
  5.     Objective-C interface file for the class file
  6.  
  7.     COPYRIGHT (C), 1995, Thomas Baier
  8.     ALL RIGHTS RESERVED.
  9.  
  10.     Date:                Rev: 0.2
  11.     1995-Jul-12            ___
  12.  
  13.  */
  14.  
  15. #ifndef _FILE_H_
  16. #define _FILE_H_
  17. /*====================================================================
  18.                        Interface of class file                        
  19. ====================================================================*/
  20. #include <objc/Object.h>
  21. #include <stdlib.h>
  22.  
  23. @interface File : Object
  24. {
  25.   FILE *handle;
  26.   char *fileName;
  27.   long  recordSize;
  28.   long  recordCount;
  29.   long  currentRecord;
  30. }
  31.  
  32. /* -------------------------- Initialize -------------------------- */
  33. -init;
  34. -initForReading: (char *) string recordSize: (long) aRecSize;
  35. -initForWriting: (char *) string recordSize: (long) aRecSize;
  36. -createForWriting: (char *) string recordSize: (long) aRecSize;
  37.  
  38. /* ----------------------------- Free ----------------------------- */
  39. -free;
  40.  
  41. /* ----------- Methods for access to Instance Variables ----------- */
  42. -(char *) fileName;
  43. -(long) recordSize;
  44. -(long) recordCount;
  45. -(long) currentRecord;
  46. -setFileName: (char *) string;
  47. -setRecordSize: (long) size;
  48.  
  49. /* ------------------------ Public methods ------------------------ */
  50. -(long) append: (void *) record;
  51. -(void *) fetch: (void *) record;
  52. -(void *) fetch: (void *) record index: (long) index;
  53. -(void *) first: (void *) record;
  54. -(void *) next: (void *) record;
  55. -(long) replace: (void *) record;
  56. -(long) replace: (void *) record index: (long) index;
  57.  
  58. @end
  59. #endif
  60.